package com.jmxcfc.blfsc.langyu.enums;

/**
 * 朗宇报告状态
 * @author pbs
 */
public enum CallBackStatusEnum {

    //发送成功
    DELIVRD("DELIVRD","发送成功"),

    //审核驳回
    REJECT("REJECT","审核驳回"),

    //手机号码发送次数过多
    DISTURB("DISTURB","手机号码发送次数过多"),

    //长短信不完整
    EMSERR("EMSERR","长短信不完整"),

    //签名错误
    SIGNERR("SIGNERR","签名错误"),

    //敏感词
    KEYWORD("KEYWORD","敏感词"),

    //短信内容不在白名单中
    WHITESMS("WHITESMS","短信内容不在白名单中"),

    //未知异常
    OTHER("OTHER","未知异常"),
    ;

    /**
     * 状态
     */
    private String status;

    /**
     * 描述
     */
    private String desc;


    CallBackStatusEnum(String status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public String status() {
        return this.status;
    }

    public String desc() {
        return this.desc;
    }


    /**
     * 根据值  获取 枚举
     * @param status
     * @return
     */
    public static CallBackStatusEnum getEnumByValue(String status) {
        CallBackStatusEnum[] instances = CallBackStatusEnum.values();
        for(CallBackStatusEnum instance : instances){
            if(instance.status().equals(status)){
                return instance;
            }
        }
        return OTHER;
    }
}
